#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>

int main(int argc,char** argv)
{
  int* data;
  data = malloc(sizeof(int));
  *data = 10;
  
  pid_t pid;

 pid = fork();
 if(pid > 0)
 {
   sleep(2);
   printf("father data is %d\n",*data);
 }
 else if(pid == 0)
 {
   *data = 100;
   printf("child pid data is %d\n",*data);
   return 0;
 }
 
  free(data);

  return 0;
}
